]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/volume: Include origin in device names
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 3 Oct 2022 16:30:13 +0000 (18:30 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 3 Oct 2022 16:37:07 +0000 (18:37 +0200)
The description alone may not be descriptive enough, so include
the origin (if available) to disambiguate the name.

This is consistent with the Sound Settings panel.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5829

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2502>

js/ui/status/volume.js

index 71a91cb04950864e950731e7111304130e1c9836..bd49cc3ae8a0783103b586a2f39b4840c4ad5dd4 100644 (file)
@@ -113,8 +113,11 @@ const StreamSlider = GObject.registerClass({
         if (!device)
             return;
 
-        const item = new PopupMenu.PopupImageMenuItem(
-            device.get_description(), device.get_gicon());
+        const {description, origin} = device;
+        const name = origin
+            ? `${description} – ${origin}`
+            : description;
+        const item = new PopupMenu.PopupImageMenuItem(name, device.get_gicon());
         item.connect('activate', () => this._activateDevice(device));
 
         this._deviceSection.addMenuItem(item);